﻿using MvcApplication.Common;
using System.Web.Mvc;

namespace MvcApplication.Controllers
{
    public class SecureController : Controller
    {
        public ActionResult Login()
        {
            return View();
        }

        [HttpPost]
        public JsonResult CheckLogin(string email, string psw)
        {
            var result = UserSession.Login(email, psw);
            return Json(new { success = result });
        }

        public ActionResult LoginOut()
        {
            UserSession.LogOut();
            return RedirectToAction("Login");
        }

    }
}
